// 该项目使用Koa2
const koa = require("koa");
const bodyParser = require("koa-body-parser");
const app = new koa();
const { testConnection } = require("@/db");

// 解析请求体
app.use(bodyParser());

// 测试数据库连接
testConnection()

const userRouter = require("./routers/user");
const mallRouter = require("./routers/mall")
app.use(userRouter.routes());
app.use(mallRouter.routes())

app.listen(8080);
console.log("App is running at http://localhost:8080");
